add terraform code for doccano service and conf file changes for nginx#31
add terraform code for doccano service and conf file changes for nginx#31bekuchicago wants to merge 9 commits into
Conversation
|
Could you move the RDS folder / module in the terraform_modules repo and then import it here? Just trying to keep the modules in the same place so we can re-use more of them with rewriting or copying and pasting around. |
|
Also move the EFS modules in that repo and make the "path" configurable / variables. |
|
new terraform_module version is 0.5.0 |
| } | ||
|
|
||
| variable "private_subnet_ids" { | ||
| default = ["subnet-02daaea0d231975df", "subnet-0c7f4570d0c82bdc3"] |
There was a problem hiding this comment.
these should be in the tfvars, we shouldn't default to them.
| } | ||
|
|
||
| variable "vpc_id" { | ||
| default = "vpc-0e20603ab3c8dd65e" #doccano dev vpc |
There was a problem hiding this comment.
this should be in the tfvars, we shouldn't default to it.
| app_name = "doccano" | ||
| vpc_id = var.vpc_id | ||
| subnet_ids = var.private_subnet_ids | ||
| acm_cert_arn = "arn:aws:acm:us-east-1:471835990085:certificate/c1cebe37-738d-4766-a635-bc23d3e8caa7" # |
There was a problem hiding this comment.
same here, this should be a variable, we shouldn't hardcode it.
| @@ -0,0 +1,87 @@ | |||
| module "doccano_ecs" { | |||
| source = "../modules/ecs" | |||
There was a problem hiding this comment.
why are you defining a new module here instead of using https://github.com/chicagopcdc/terraform_modules/tree/main/aws/ecs?
Is it a use case that is hard to generalize and parametrize?
If so that is good, otherwise we should try to move the module to the terraform module repo and import it here so we can reuse it for other projects.
There was a problem hiding this comment.
yep, I will update this to use module with reference to terraform_modules repo, initially I thought local reference was more appropriate
| resource "aws_ssm_parameter" "DATABASE_URL" { | ||
| name = "/${var.environment}/${var.app_name}/DATABASE_URL" | ||
| type = "SecureString" | ||
| value = "postgres://doccano:${module.rds.rds_random_password}@${module.rds.rds_enpoint}/doccano?sslmode=disable" |
There was a problem hiding this comment.
is rds_enpoint just a typo here or is it carried from the imported module output?
| resource "aws_ssm_parameter" "DATABASE_URL" { | ||
| name = "/${var.environment}/${var.app_name}/DATABASE_URL" | ||
| type = "SecureString" | ||
| value = "postgres://doccano:${module.rds.rds_random_password}@${module.rds.rds_enpoint}/doccano?sslmode=disable" |
There was a problem hiding this comment.
we should update sslmode=require instead of disable. The new version of RDS enforce the SSL.
There was a problem hiding this comment.
sounds good, it was just taken from current values at the time
|
Can you add some outputs like:
|


No description provided.